package SpringBoot.spring_boot_starter_security.D02_定义需要验证和不需要验证URL.config.startup;

import javax.sql.DataSource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

import com.titan.core.utils.db.JdbcUtils;
import com.titan.core.utils.io.ConsoleUtils;
import com.titan.core.utils.spring.SpringUtils;

public class ApplicationContextAwareStartup implements ApplicationContextAware {
//    private final static Logger log = LoggerFactory.getLogger(ApplicationContextAwareStartup.class);
    
    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
//        log.debug("ApplicationContextAwareStartup...........................");
        ConsoleUtils.out("ApplicationContextAwareStartup...........................");
        try {
            SpringUtils.initApplicationContext(applicationContext);
//            JdbcUtils.setDataSource(SpringUtils.getBean(DataSource.class));
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
